<?php use_helper('Date') ?>
<tr>
  <td class="post_author">
    <?php if (sfConfig::get('app_sfSimpleForumPlugin_show_author_details', true)): ?>
    <?php echo include_partial('sfSimpleForum/author', array('author' => $post->getSfGuardUser(),'post' => $post, 'rankArray'=>$rankArray)) ?>
    <?php else: ?>
    <?php echo link_to(get_partial('sfSimpleForum/author_name', array('author' => $post->getAuthorName())), '@forum_user?username='.$post->getAuthorName()) ?><br/>
    <?php endif; ?>
    
  </td>
  <td class="post_message">
    <div class="post_details">
      <?php echo link_to($post->getsfSimpleForumForum()->getName(), 'sfSimpleForum/forum?forum_name='.$post->getsfSimpleForumForum()->getSlug()) ?>
     &raquo;
      <?php echo link_to($post->getTitle(), 'sfSimpleForum/post?id='.$post->getId()) ?>

      <?php $validityTimePost = strtotime($post->getUpdatedAt()) + sfConfig::get('app_sfSimpleForumPlugin_validity_time_post', 15*60); ?>
      <?php $isValid = time() < $validityTimePost ? true : false ?>

      <?php if($sf_user->isAuthenticated() && $sf_user->getGuardUser()->getId() == $post->getUserId() && $isValid ): ?>
      <?php echo link_to(image_tag('/images/icons/edit.png', array( 'alt' => 'éditer', 'width' => '16', 'height' => '16' )),
                         url_for("@forum_edit_post?id=" . $post->getId() . "&topic_id=" . $post->getSfSimpleForumTopic()->getId() . "&stripped_title=" . $post->getSfSimpleForumTopic()->getSlug()), array('title' => 'Editer ce message')); ?>
      <?php endif; ?>

    </div>
    <em>écrit le <?php echo date('d/m/Y', strtotime($post->getCreatedAt())) ?></em>
    <a name="post<?php echo $post->getId() ?>"></a>
    <div class="post_content" id="post-<?php echo $post->getId() ?>">
      <?php echo nl2br($post->getContent(ESC_RAW)) ?>
    </div>

    <?php if ($sf_user->hasCredential('moderator')): ?>
      <?php include_partial('sfSimpleForum/post_moderator_actions', array('post' => $post)) ?>
    <?php endif; ?>
  </td>
</tr>
<tr class="spacer"><td colspan="2"></td></tr>
